#pragma once

#include "IXTheme.h"
#include "Logic/Include/XBaseObjImpl.h"
#include <list>

class CXThemeImpl : public CXBaseObjImpl<IXTheme>
{
    typedef CXBaseObjImpl<IXTheme> superclass;
    BEGIN_DEF_SKIN_CLASS(CXThemeImpl, superclass, gs_strGuidXSkin)
        IMP_BASIC_INTF(IXTheme,     eIntf_Singleton)
    END_DEF_SKIN_CLASS();

public:
    CXThemeImpl();
    virtual ~CXThemeImpl();

public:
    // IXTheme
    virtual HRESULT STDMETHODCALLTYPE   put_Lang(IN LPCTSTR szLang);
    virtual HRESULT STDMETHODCALLTYPE   get_Lang(OUT BSTR* pbstrLang);

    virtual HRESULT STDMETHODCALLTYPE   put_HSL(IN int nHue, IN int nSat, IN int nLight);
    virtual HRESULT STDMETHODCALLTYPE   get_HSL(OUT int* pnHue, OUT int* pnSat, OUT int* pnLight);

    virtual HRESULT STDMETHODCALLTYPE   AddThemeListener(IXThemeListener* pListener);
    virtual HRESULT STDMETHODCALLTYPE   RemoveThemeListener(IXThemeListener* pListener);

    virtual COLORREF STDMETHODCALLTYPE  AdjustColor(COLORREF Color);

protected:
    HRESULT InvokeThemeListener(eSkinSettingFlag flag, LPARAM lParam);

protected:
    typedef std::list<IXThemeListener*> ThemeListenerList;
    ThemeListenerList   m_ThemeListener;

    int     m_nColorHue;
    int     m_nColorSat;
    int     m_nColorLight;
};

